package edu.ccut.saturn.studio.naviagtor.saturndata;

import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;

import edu.ccut.saturn.studio.Activator;
import edu.ccut.saturn.studio.Images;
import edu.ccut.saturn.studio.saturndata.model.DataItem;

public class SaturnDataLabelProvider implements ILabelProvider {

	public Image getImage(Object element) {
		if (element instanceof DataItem) {
			return Activator.getImage(Images.DATAFIELD);
		}

		return null;
	}

	public String getText(Object element) {
		if (element instanceof DataItem) {
			DataItem dataItem = (DataItem) element;

			String javaType = dataItem.getJavaType();
			String name = dataItem.getName();

			return name + ":" + javaType;
		}

		return null;
	}

	public void addListener(ILabelProviderListener listener) {
	}

	public void dispose() {
	}

	public boolean isLabelProperty(Object element, String property) {
		return false;
	}

	public void removeListener(ILabelProviderListener listener) {
	}
}
